﻿/////////////////////////////////
//
//WORNING!!!! DO NOT RUN THIS IF YOU HAVE DOCUMENTS THAT YOU DO NOT WANT TO DELETE IN GovernanceInputFile DATABASE fs.files AND fs.chunks
//DO NOT RUN ON PRODUCTION SERVER - use this only for test 
////////////////////////////////


use GovernanceDW_A
//find profile with who have insights
//db.getCollection('GovernanceCompanyProfile').find({ Insights: { $ne: null } });

//remove all Insights and AnalystView from GovernanceCompanyProfile
db.getCollection('GovernanceCompanyProfile').update({}, { $set: { Insights: null, AnalystView: "" } }, { multi: true });

use GovernanceInputFile
//remove all governancePdfMetadata
db.getCollection('GovernancePdfProfileMetadata').remove()
//remove all insights from GovernanceInsightInputFile
db.getCollection('GovernanceInsightInputFile').remove()
//remove all from fs.files !! Atention all files will be removed
db.getCollection('fs.files').remove()
//remove all from fs.chuncs !! Atention all files will be removed
db.getCollection('fs.chunks').remove()
